<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Selection</title>
</head>
<!-- https://blog.csdn.net/m0_37885651/article/details/88353305 -->
<body>
    <div><span>anotherspan</span><span>span文本<i>i文本<a>a文本<b>b文本<u>u文本</u></b></a></i></span></div>
</body>
<script>
    // 获取选中节点
</script>

</html>